{% extends "op/base.html" %}

{% load i18n %}

{% cycle 'odd' 'even' as color %}
{% cycle 'dongle_odd' 'dongle_even' as dongle_color %}

{% block title %}Status{% endblock %}

{% block content %}
	<table class="info" cellspan="3">
	    <tr class="{% cycle color %}">
		<th>Dbus</th>
		<td>{{ dbus|yesno:_("yes,no")|capfirst }}
	    </tr>
	    <tr class="{% cycle color %}">
		<th>{% trans "Adapter" %}</th>
		<td>{{ adapter|yesno:_("yes,no")|capfirst }}
	    </tr>
		
	    {% if error %}
		<tr class="error">
		    <th>{% trans "Error Message" %}</th>
		    <td>{{ error }}</td>
		</tr>
	    {% else %}
	      {% for key, value in adapter.properties.iteritems %}
	        <tr class="{% cycle color %}">
	    	    <th>{{ key }}</th>
		    <td>{{ value }}</td>
		</tr>
	     {% endfor %}
	    {% endif %}
	</table>
    </div>

    {% for remote in remotedevices %}
	<div id="content" class="up">
	    <table>
		<td>
		    <table class="info" cellspan="3">	    
			{% for key, value in remote.properties.iteritems %}
			    <tr class="{% cycle color %}">
				<th>{{ key }}</th>
				<td>{{ value }}</td>
			    </tr>
			{% endfor %}
		    </table>
		</td>
	    </table>
    	</div>
    {% endfor %}
    
    <div id="content" class="up">
	<table>
	    <td>
		<table class="actions" cellspan="3">
			<tr class="table_tytle">
			    <td><b>{% trans "Actions" %}</b></td>
			</tr>		
			{% if error %}
			{% else %}
			<tr class="action_button">
			    <td>
				<FORM METHOD="post" ACTION="">
				<INPUT TYPE="submit" VALUE="{% trans "Discovery" %}">
				<input type="hidden" name="method" value="StartDiscovery">
				<input type="hidden" name="sleep" value="15">
				</FORM>
			    </td>
			    <td><b>{% trans "You will have to wait for 15 seconds for this to complete!" %}</b></td>
			</tr>
			<tr class="action_button">
			    <FORM METHOD="post" ACTION="">
				<table>
				    <tr>
					<th>{% trans "Property" %}</th>
					<td><input type="text" name="name"/></td>
					<th>{% trans "Value" %}</th>
					<td><input type="text" name="value"/></td>
					<input type="hidden" name="method" value="SetProperty">
					<td><INPUT TYPE="submit" VALUE="{% trans "Set" %}"></td>
				    <tr>
				</table>
			    </FORM>
			</tr>
			{% endif %}
		</table>
		</td>
	</table>
      </div>
{% endblock %}
